﻿using System;
using System.Text.Json;

namespace EsSample
{
    class Program
    {
        static void Main(string[] args)
        {
            //LogService.Write();
            var log = LogService.ReadById("id_1");
            Console.WriteLine(JsonSerializer.Serialize(log.Source));
            Console.WriteLine("---------------------------------------");
            var result = LogService.Read();
            var documents = result.Documents;
            var fc = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.DarkRed;
            foreach (var doc in documents)
            {
                Console.WriteLine(JsonSerializer.Serialize(doc));
                Console.WriteLine("---------------------------------------");
            }
            Console.ForegroundColor = fc;

            Console.ReadKey();
        }
    }
}